﻿<SwapChainBackgroundPanel
    x:Class="TicTacToe.DirectXPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TicTacToe"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    PointerMoved="OnPointerMoved" PointerReleased="OnPointerReleased" PointerPressed="OnPointerPressed">
    
    <SwapChainBackgroundPanel.Resources>
        <local:WinnerToTextConverter x:Key="winnerToTextCoverter"/>
    </SwapChainBackgroundPanel.Resources>
    
    
    <StackPanel Orientation="Horizontal" x:Name="PlayerInfoPanel">
        <TextBlock x:Name="PlayerLbl" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="42" Height="72" Text="Player:" Margin="0,0,0,50"/>
        <TextBlock x:Name="PlayerTextBlock" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="42" Height="72" Text="{Binding Path=CurrentPlayer}" Margin="10,0,0,50"/>
    </StackPanel>
  
    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,8,0,0">
        <Button x:Name="NewGameButton" Content="New Game" Click="NewGameButton_Click"/>
    </StackPanel>
    
    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,8,0,0">
        <TextBlock x:Name="WinnerTextBlock" FontSize="42" Height="72" Text="{Binding Path=WinnerPlayer, Converter={StaticResource winnerToTextCoverter}}" Margin="10,0,0,50"/>
    </StackPanel>
    
    <Page>
        <Page.BottomAppBar>
            <AppBar Padding="10,0,10,0">
                <Grid  >
                    <StackPanel x:Name="LeftPanel" Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Left">
                        <Button x:Name="Previous" Style="{StaticResource PreviousAppBarButtonStyle}" Tag="Previous" AutomationProperties.Name="Previous Color" Click="CycleColorPrevious"/>
                    </StackPanel>
                    <StackPanel x:Name="RightPanel" Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
                        <Button x:Name="Next" Style="{StaticResource NextAppBarButtonStyle}" Tag="Next" AutomationProperties.Name="Next Color" Click="CycleColorNext"/>
                    </StackPanel>
                </Grid>
            </AppBar>
        </Page.BottomAppBar>
    </Page>
</SwapChainBackgroundPanel>
